﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraGrid.Views.Grid;
using Ersur.DevTeam;
using Extensions;

namespace Ersur
{
    public partial class Entities : XForm
    {
        public Entities()
        {
            InitializeComponent();
        }

        private void Entities_Load(object sender, EventArgs e)
        {
            gvColour.Init(Data.DB.Colour);
            gvBallSize.Init(Data.DB.BallSize);
            gvColour.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom;
            gvBallSize.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom;
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            Data.TAM.ColourTableAdapter.Update(Data.DB.Colour);
            Data.TAM.BallSizeTableAdapter.Update(Data.DB.BallSize);
            AppSession.MainForm.Info = "Entities are saved. " + DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss");
        }
    }
}
